package com.example.attendance_back.controller;


import com.example.attendance_back.model.ResponseMessage;
import com.example.attendance_back.model.Student;
import com.example.attendance_back.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/stu")
@CrossOrigin
public class StudentController {

    @Autowired
    private StudentService service;

    @GetMapping("/list")
    public ResponseMessage list(){

        return service.getAll();
    }
}
